package com.xxp.controller;

import com.xxp.common.Result;
import com.xxp.entity.tesewenhua;
import com.xxp.service.WenhuaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/wenhua")
public class WenhuaController {
    @Autowired
    private WenhuaService wenhuaService;

    @GetMapping("/{id}")
    public Result selectById(@PathVariable Integer id){
        tesewenhua tesewenhua = wenhuaService.selectById(id);
        return Result.success(tesewenhua);
    }
    @GetMapping("/all")
    public Result selectAll(){
        List<tesewenhua> tesewenhuas = wenhuaService.selectAll();
        return Result.success(tesewenhuas);
    }
}
